<?php
/**
 * 地区查询工具栏
 */
class LocationsFinder extends CWidget {
    public function run() {
        $criteria = new CDbCriteria();
        $criteria->condition = 'parent_id = 1';
        $criteria->select = array('id', 'name');
        $criteria->order = 'order_pos ASC';
        $provinces = Location::model()->findAll($criteria);
        $items = array(
            'index'   => Yii::t('common', 'index'),
            'create' => Yii::t('common', 'create'),
        );

        $this->render('LocationsFinder', array(
            'provinces' => $provinces,
            'items' => $items,
        ));
    }
}
